package com.youshang520i.ratelimiter.controller;

import com.youshang520i.ratelimiter.config.annotation.RateLimiter;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author youshang
 */
@RestController
@RequestMapping("/index")
public class IndexController {

    @RateLimiter(fallback = "error")
    @RequestMapping("")
    public String index(String str) {
        System.out.println("通过");
        return "index -> test";
    }

    public String error(String str) {
        System.out.println("限流");
        return "限流";
    }
}
